#include "sale.h"
#include <iostream>

namespace SALES
{
    void setSales(Sales &s, const double ar[], int n)
    {
        double max = -1, min = 100000, sum = 0;
        for (int i = 0; i < n; i++)
        {
            s.sales[i] = ar[i];
            if (ar[i] > max) max = ar[i];
            if (ar[i] < min) min = ar[i];
            sum += ar[i];
        }
        s.max = max;
        s.min = min;
        s.average = sum / n;

        
    }

    void setSales(Sales &s)
    {

    }

    void showSales(const Sales & s)
    {
        using std::cout;
        using std::endl;

        for (int i = 0; i < QUARTERS; i++)
        {
            cout << s.sales[i] << " ";
        }
        
        cout << "MIN:" << s.min << ", MAX:" << s.max << ", AVG:" << s.average << endl;
    }
} // namespace SALES
